class TextblocksController < ApplicationController
  before_filter :authorization_required

  # GET /textblocks/1/edit
  def edit
    @textblock = Textblock.find(params[:id])
    render :layout => false
  end

  # PUT /textblocks/1
  # PUT /textblocks/1.xml
  def update
    @textblock = Textblock.find(params[:id])
    if @textblock.update_attributes(params[:textblock])

#    render :nothing => true #:partial => 'view_by_admin', :locals => { :textblock => @textblock }, :layout => false
      
      render :update do |page|
        page.replace_html "textblock_#{@textblock.id}", :text => @textblock.content
      end
    end
  end

end
